package com.rich.widget.span

import android.graphics.Canvas
import android.graphics.LinearGradient
import android.graphics.Paint
import android.graphics.Shader
import android.widget.LinearLayout
import android.text.SpannableStringBuilder
import android.text.Spanned
import com.rich.widget.span.LinearGradientFontSpan.Companion.GRADIENT_ORIENTATION_HORIZONTAL
import com.rich.widget.span.LinearGradientFontSpan.Companion.GRADIENT_ORIENTATION_VERTICAL

/**
 * 线性渐变效果的具体实现
 */
class SolidFontSpan(private var textColor: Int) : FontSpan() {

    override fun onDraw(
        canvas: Canvas,
        paint: Paint,
        text: CharSequence,
        start: Int,
        end: Int,
        x: Float,
        top: Int,
        y: Int,
        bottom: Int
    ) {
        paint.color = textColor
        canvas.drawText(text, start, end, x, y.toFloat(), paint)
    }
}

